package com.jinyao.exploit.modules.sys.web;

import com.jinyao.exploit.common.base.User;
import com.jinyao.exploit.common.base.entity.BaseResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户表Controller
 *
 * @author tm
 * @version 2019/06/29 16:12
 */
@RestController
@RequestMapping(value = "${baseAdminPath}/sys/user")
public class UserController {

    @RequestMapping("login")
    public BaseResult login(User user){
        System.out.println(user);
        return BaseResult.ok("token-admin");
    }

    @RequestMapping("getByToken")
    public BaseResult login(String token){
        System.out.println(token);
        return BaseResult.ok("\"data\":{\"roles\":[\"admin\"],\"introduction\":\"I am a super administrator\",\"avatar\":\"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif\",\"name\":\"Super Admin\"}");
    }

}
